package com.corundumstudio.socketio.demo;

import com.corundumstudio.socketio.AuthorizationListener;
import com.corundumstudio.socketio.HandshakeData;

/**
 * @author zhunzhong
 * @datetime 2021/8/12 10:54
 * @description
 */
public class TokenAuthorizationListener implements AuthorizationListener {

    @Override
    public boolean isAuthorized(HandshakeData data) {
        String token = data.getSingleUrlParam("token");
        if ("123".equalsIgnoreCase(token)) {
            return false;
        }
        return true;
    }
}
